Inheritance diagram for CWhileInCS:

Public Member Functions | |
| CWhileInCS (TMCCriticalSection *theCS) | |
| ~CWhileInCS () | |
| void | Clean () |
Protected Attributes | |
| TMCCriticalSection * | fCS |
One of the advantage of using a local variable is that the destructor is called if an exception is thrown or if return is called in the middle of the function
For instance, you could write:
{
CWhileInCS cs(criticalSection);
// Code excuted inside the critical section
...
}
// Code excuted outside the critical section
...
|
|
|
|
|
|
|
|
|
|
|
|
1.4.5